﻿using System.ComponentModel.Composition;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using PAMD.Data.Ajax.Services.Common;
using PAMD.Database.Services;

namespace PAMD.Data.Ajax.Services.Controllers
{
    [Export]
    [PartCreationPolicy(CreationPolicy.NonShared)]
    public class CommonController : ApiController
    {
        [Import(typeof(CommonService))]
        private CommonService Service { get; set; }

        public HttpResponseMessage GetCountryList()
        {
            var countries = Service.GetCountryList();
            return Request.CreateResponse(HttpStatusCode.OK, countries, ResponseHelper.JSonFormatter);
        }
    }
}
